import { CalendarPage } from '@pages/CalendarPage'
import { DashboardPage } from '@pages/DashboardPage'
import { HomePage } from '@pages/HomePage'
import { NotesPage } from '@pages/NotesPage'
import { PageNotFound } from '@pages/PageNotFound'
import { ProjectsPage } from '@pages/ProjectsPage'
import { TasksPage } from '@pages/TasksPage'
import { UserSettingsPage } from '@pages/UserSettingsPage'
import { Kanban } from '@widgets/Kanban'
import { RouteProps } from 'react-router-dom'

export enum AppRoutes {
  CALENDAR = 'calendar',
  DASHBOARD = 'dashboard',
  KANBAN = 'kanban',
  NOT_FOUND = 'not_found',
  NOTES = 'notes',
  PROJECTS = 'projects',
  TASK = 'task',
  USER_SETTINGS = 'user',
  WELCOME = 'welcome',
}

export const RoutePath: Record<AppRoutes, string> = {
  [AppRoutes.CALENDAR]: '/calendar',
  [AppRoutes.DASHBOARD]: '/dashboard',
  [AppRoutes.KANBAN]: '/projects/:id',
  [AppRoutes.NOT_FOUND]: '*',
  [AppRoutes.NOTES]: '/notes',
  [AppRoutes.PROJECTS]: '/projects',
  [AppRoutes.TASK]: '/tasks',
  [AppRoutes.USER_SETTINGS]: '/user-settings',
  [AppRoutes.WELCOME]: '/',
}

export const routeConfig: Record<AppRoutes, RouteProps> = {
  [AppRoutes.CALENDAR]: {
    element: <CalendarPage />,
    path: RoutePath.calendar,
  },
  [AppRoutes.DASHBOARD]: {
    element: <DashboardPage />,
    path: RoutePath.dashboard,
  },
  [AppRoutes.KANBAN]: {
    element: <Kanban />,
    path: RoutePath.kanban,
  },
  [AppRoutes.NOT_FOUND]: {
    element: <PageNotFound />,
    path: RoutePath.not_found,
  },
  [AppRoutes.NOTES]: {
    element: <NotesPage />,
    path: RoutePath.notes,
  },
  [AppRoutes.PROJECTS]: {
    element: <ProjectsPage />,
    path: RoutePath.projects,
  },
  [AppRoutes.TASK]: {
    element: <TasksPage />,
    path: RoutePath.task,
  },
  [AppRoutes.USER_SETTINGS]: {
    element: <UserSettingsPage />,
    path: RoutePath.user,
  },
  [AppRoutes.WELCOME]: {
    element: <HomePage />,
    path: RoutePath.welcome,
  },
}
